/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.nc.kyiv.yellow.sociallibrary.reports;

import java.io.*;
import java.nio.channels.*;
import java.util.AbstractList;
import java.util.Date;
import java.util.LinkedList;
import java.util.List;

/**
 *
 * @author Виталий
 */
public class BIReportBuilder implements IReportBuilder {

    public List<ReportNode> buildReport() throws ReportBuildingException {
        // Create dummy report structure for test
        List<ReportNode> rootlist = new LinkedList<ReportNode>();
        ReportNode root = new ReportNode("Book Info");
        ReportNode pageHeader = new ReportNode("PageHeader");
        ReportNode title = new ReportNode("Title");
        ReportNode biGrid = new ReportNode("BIGrid");
        ReportNode bi = new ReportNode("BIGridRow");
        pageHeader.setAttribute("datetime", new Date());
        title.setAttribute("text", "Published Books");
        title.setAttribute("pubdate",new Date());
        
        bi.setAttribute("isbn", "1111111111111");
        bi.setAttribute("title", "qqqqqqqqqq");
        bi.setAttribute("author", "qqqqqq");
        bi.setAttribute("genre", "Fiction");
        bi.setAttribute("pages", new Integer(111));
        bi.setAttribute("rating", new Integer(1));
        bi.setAttribute("pubdate", new Date());
        bi.setAttribute("publisher", "vspivak94");
        root.addChild(pageHeader);
        root.addChild(title);
        root.addChild(biGrid);
        biGrid.addChild(bi);
        rootlist.add(0, root);
        return rootlist;
    }
}
